#include "csgobject.h"

CSGObject::CSGObject(Object3D *obj1, Object3D *obj2, int operation)
{
	this->obj1 = obj1;
	this->obj2 = obj2;
	this->mat1 = mat1;
	this->mat2 = mat2;
	this->operation = operation;
}

bool CSGObject::intersect(const Ray &r, Hit &h, float tmin)
{
	//h = Hit(0,obj1->material,Vec3f(0,1,0));cout << "bla" << endl;
	if(operation==CSG_UNION)
	{
		bool tmp1 = obj1->intersect(r,h,tmin);
		bool tmp2 = obj2->intersect(r,h,tmin);
		if(tmp1||tmp2)
			return true;
	}
	if(operation==CSG_INTERSECTION)
	{

	}
	return false;
}
